﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using Demo.Client.Presentation;
using XEvolve.Chromatic;
using XEvolve.Core;
using XEvolve.Core.Runtime;
using XEvolve.Core.Runtime.PluginProviders;
using XEvolve.Presentation;

namespace Demo.Client
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App
    {
        private Platform platform;
        protected override void OnExit(ExitEventArgs e)
        {
            base.OnExit(e);

            platform.Stop();            
        }

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            platform = Platform.Current;
            platform.InstallPlugins(new PluginList(typeof(CorePlugin), typeof(PresentationPlugin), typeof(ThemesPlugin), typeof(ClientPresentationPlugin)));

            platform.Start();

            var navigator = platform.ServiceLocator.GetService<INavigator>();
            navigator.Open("/Main");
        }
    }
}
